Ext.define('Usws.view.sysUser.SysUser', {
    extend: 'Ext.grid.Panel',
    xtype: 'SysUser-Grid',
    store: 'SysUser',
    title: '用户信息',
    selType:'checkboxmodel',//设定选择模式  
    multiSelect:true,//运行多选  
    layout:'column',
    initComponent: function () {
    	this.tbar = [
    	               {
 						  xtype: 'panel',
 						  layout:'hbox',
 	       	              border:false,
 	       	              items:[
 	 	       	              {xtype: 'button', text: '添加用户',  action: 'add' ,margin:'5 5 5 5'},
 	 	    	              {xtype: 'button', text: '批量删除',  action: 'deleteMore' ,margin:'5 5 5 5'}
 	       	            	 ]
 					  }
    	            ];
        this.columns = [
            {
                text     : '用户账号',
                width    : '15%',
                sortable : true,
                dataIndex: 'loginName'
            },
            {
                text     : '邮箱',
                width    : '30%',
                sortable : true,
                dataIndex: 'emailAddr'
            },
            {
                text     : '用户全称',
                width    : '25%',
                sortable : true,
                dataIndex: 'fullName'
            },
            {
                text     : '性别',
                width    : '10%',
                sortable : true,
                dataIndex: 'genderType',
                renderer: function(value){
                    if (value === 'M') {
                        return '男';
                    } else if(value === 'F') {
                    	return '女';
                    }
                }
            },
            {
                text     : '角色',
                width    : '10%',
                sortable : true,
                dataIndex: 'roleName'
            },
            {
	            text:'操作',
	            sortable: false,
	            xtype: 'actioncolumn',
	            margin:'5px',
	            align:'center',
	            width : '10%',
	            items: [{
	            	icon: '/ext4/resources/images/cog_edit.png',  // Use a URL in the icon config
	                tooltip: '编辑',
	                action: 'edit',
	                handler: function(grid,rowIndex,colIndex,item,e) {
	                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
	                }
	            },'-',{
	                icon: '/ext4/resources/images/delete.gif',
	                tooltip: '删除',
	                action: 'delete',
	                handler: function(grid,rowIndex,colIndex,item,e) {
	                	this.fireEvent('itemclick', this, grid, rowIndex, colIndex, item, e);
	                }
	            }]
            }];
        this.bbar= {
            xtype: 'pagingtoolbar',
            pageSize: 40,
            store: 'SysUser',
            displayInfo: true
        };
        this.callParent();
    }
});